import printer.BinaryTrees;
import tree.BST;

public class Test {

    public static void main(String[] args) {
        BST<Integer> tree=new BST<>((a, b)->a-b);
        int[] arr=new int[]{7, 4, 9, 2, 5, 8, 11, 3, 12, 1};
        for (int i = 0; i < 10; i++) {
            tree.add(arr[i]);
        }
//        Visitor<Person> visitor=new Visitor<Person>() {
//            @Override
//            public boolean visit(Person element) {
//                System.out.println(element.getAge());
//                return element.getAge()==2?true:false;
//            }
//        };
//        tree.preOrderTraversal(tree.getRoot(),visitor);
        BinaryTrees.println(tree);
        tree.remove(9);
        BinaryTrees.println(tree);
        tree.remove(4);
        BinaryTrees.println(tree);
        tree.remove(2);
        BinaryTrees.println(tree);
        tree.remove(3);
        BinaryTrees.println(tree);
        tree.remove(1);
        BinaryTrees.println(tree);


    }
}
